
	<?php $description = substr($row['description'], 0, 135); ?>
	
<a href="#" style="word-spacing:2px;font-size:small" 
	onclick="Effect.toggle('<?php echo 'ROW-' . $row['id']; ?>', 'slide'); viewItem(<?= $row['id'] ?>); return false;"><?= $row['item'] . ' - $' . $row['price']; ?>
	
	<?php
	if($row['hits'] != 0){
		echo '(' . $row['hits'] . ' likes)';
	}
	
	?>
	
	<?php
	
	if(strlen($description) > 135){
		$description = $description . '...';
	}
	
	?>
	
	<?= '<small> - ' . $description . '</small>' ?>
	
	</a>

<div style="float:right;font-weight:bolder;word-spacing:2px;font-size:1em;">

<?php 
date_default_timezone_set('America/Denver');
$created = new DateTime($row['created']);
$deleted = new DateTime($row['created']);

$todaysDate = date('d.m.y');
$today = new dateTime($todaysDate);

$deleted->modify("+60 day");

$interval = $today->diff($deleted);

$strlen = strlen($row['username']);

$nameEx = str_split($row['username']);

echo $nameEx[0];

for($i = 0; $i < ($strlen - 1); $i++){
	echo '*';
} 
	echo '@' . $row['domain'];
?>
	
</div>

</div>

<?php
//if(item()=='empty'){
//	$postDisplay = '';
//} else {
	$postDisplay = 'display:none;';
//}

?>


<div class="postitem" id="<?php echo 'ROW-' . $row['id']; ?>" style="border-left:1 solid #9da6ab; border-bottom:1solid #9da6ab; border-right:1 solid #9da6ab; padding-left:10px;padding-right:10px;<?= $postDisplay ?>margin-bottom:3px;">
  <div>
	
    <?= $row['description'] ?><br />&nbsp;<br />
	


		<div style=" ">
			<i class="icon-globe"></i>&nbsp;<?= getUrl() . '?item=' . $row['id'] ?><br />&nbsp;
		Views: <?= $row['views'] ?> / 
		Created: <?= $created->format('Y-m-d'); ?> / 
		Deletion Date <?= $deleted->format('Y-m-d') ?> /
		Days till Deletion <?php echo $interval->format('%R%a days') ?>
		
	<?php if(isLi()){ ?>
		<table>
			<tr>
				<td>
		<form id="contactForm" action="contactSeller.php" method="post">
			<input type="hidden" name="sellerEmail" value="<?= $row['username'] ?>@<?= $row['domain'] ?>">
			<input type="hidden" name="item" value="<?= $row['item'] ?>" />
			<button type="submit" class="btn btn-small"><i class="icon-comment"></i>Contact Seller</button>
		</form>
		</td><td>
		<?php if(in_array($row['id'], likes())){ ?>
			You liked this
		<?php } else {?>
			<div action="#" style="padding:none;margin:none;" name="likeButton<?= $row['id'] ?>" id="likeButton<?= $row['id'] ?>">
				<form id="likeForm" onsubmit="return likeItem(<?= $row['id'] ?>); return false;">
					<button type="submit" class="btn btn-small"><i class="icon-star"></i>Like It</button>
				</form>
			</div>
		<?php } ?>
		</td><td>
		<form id="abuseForm" action="reportAbuse.php" method="post">
			<input type="hidden" name="abuser" value="<?= $row['username'] ?>@<?= $row['domain'] ?>">
			<input type="hidden" name="reporter" value="<?= liFullname() ?>" />
			<input type="hidden" name="post" value="<?= getUrl() . '?item=' . $row['id'] ?>" />
			<input type="hidden" name="abuse" value="abuse" />
			<button type="submit" class="btn btn-small"><i class="icon-flag"></i>Report Abuse</button>
		</form>
		</td>
		</tr>
		</table>
		<?php } ?>
	</div>
  </div>
</div>

